package com.epirus.cyjl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.WindowManager;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;

public class MainActivity extends Activity {
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
//		initView();
	}

	private void initView() {
		// TODO Auto-generated method stub
		ListView listView = (ListView) findViewById(R.id.list);
		List<HashMap<String, String>> data = new ArrayList<HashMap<String, String>>();
		for (int i = 0; i <10; i++) {
		 HashMap<String, String> hashMap=new HashMap<String, String>();
		 hashMap.put("ask", "一事无成");
		 hashMap.put("answer","成事在人");
		 data.add(hashMap);
		}
		SimpleAdapter adapter = new SimpleAdapter(this, data,
				R.layout.askanswer, new String[] { "ask", "answer" },
				new int[] { R.id.ask, R.id.answer });
		listView.setAdapter(adapter);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}
}
